package com.yootk.main;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.Arrays;

/**
 * profiles动态设置：
 * Add VM Options
 * -Dspring.profiles.active=dev
 * -Dspring.profiles.active=test
 * -Dspring.profiles.active=product
 */
public class StartYootkSpringApplication {
    private static final Logger LOGGER = LoggerFactory.getLogger(StartYootkSpringApplication.class);

    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("spring/spring-base.xml");
        LOGGER.info("Profile = {}", Arrays.toString(context.getEnvironment().getActiveProfiles()));
    }
}
